<template>
	<view class="allimg">
		<h3 style="margin-bottom: 10rpx;font-weight: normal;">全部商品</h3>
		<view class="scrollImg">
			<scroll-view scroll-x="true" class="scroll">
				<view v-for="item in product">
					<image :src="item.cover_img" mode="" @click="handleTodetail(item)"></image>
				</view>
				
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "allImg",
		data() {
			return {

			};
		},
		methods:{
			handleTodetail(item){
				// console.log(item)
				uni.navigateTo({
					url:`../../pages/detail/detail?id=${item.id}`
				})
			}
		},
		props:{
			product:{
				type:Array,
				default(){
					return []
				}
			}
		}
	}
</script>

<style scoped>
	*{
		box-sizing: border-box;
	}
	.allimg {
		box-sizing: border-box;
		width: 100%;
		height: 400rpx;
		padding: 20rpx;
		background-color: #FFFFFF;
		border-top: 20rpx solid #efefef;
	}

	.scrollImg {
		width: 100%;
		height: 280rpx;
	}

	.scroll {
		width: 100%;
		overflow: hidden;
		white-space: nowrap;
	}

	.scroll view {
		display: inline-block;
		width: 40%;
		height:260rpx ;
		background-color: #f3f3f3;
		border-radius: 10rpx;
		margin-right: 10rpx;
	}
	.scroll view:last-child{
		margin-right: 0;
	}
	image{
		width: 100%;
		height:100% ;
		border-radius: 10rpx;
	}
</style>
